<my-pageheader></my-pageheader>

<mat-card style="margin: 20px 20px 50px 20px">
    <h2 align="center">车牌识别</h2>
    <br><br>

    <div class="row justify-content-center">
        <mat-card style="width: 90%">
            <div>
                <input type="file" ng2FileSelect [uploader]="fileSelector" accept=".jpg, .jpeg, .png, .gif, image/*" [disabled]="sending" />
            </div>
            <br>
            <div>
                <img style="max-width: 100%" src="{{selectedImgDataUrl}}" alt="">
            </div>
        </mat-card>
    </div>
    <div class="row justify-content-center">
        <mat-card style="width: 90%; margin-top: 20px">
            <div *ngIf="results.length > 0 && img_url && !sending">
                <img style="max-width: 100%" src="{{img_url}}" alt="">
            </div>
            <div *ngIf="results.length > 0 && !sending">
                <br>
                <ul>
                    <li *ngFor="let result of results">
                        {{result}}
                    </li>
                </ul>
            </div>
            <div *ngIf="results.length < 1  && !sending">
                没有找到车牌...
            </div>
            <p *ngIf="!img_url && !sending && !error">识别结果</p>
            <p *ngIf="sending">正在努力识别...</p>
            <mat-spinner *ngIf="sending"></mat-spinner>
            <p *ngIf="error">出错啦...</p>
        </mat-card>
    </div>
</mat-card>
